tmp<-read.table("intapp.res")
intapp <- t(tmp)
tmp <- read.table("eulapp.res")
eulapp <- t(tmp)
tmp<-read.table("intappav.res")
intappav <- t(tmp)
tmp <- read.table("eulappav.res")
eulappav <- t(tmp)

bsresult <- 11.5543
intapp <- abs(intapp - bsresult)
intappav <- abs(intappav - bsresult)
eulapp <- abs(eulapp - bsresult)
eulappav <- abs(eulappav - bsresult)

maxapp <- max(intapp, eulapp, intappav, eulappav)
minapp <- min(intapp, eulapp, intappav, eulappav)
iters <- seq(100, 15100, 500)
plot(iters,intapp, type="l",col="red",ylim=c(minapp,0.35),xlab="Monte Carlo Iterations",ylab="Error", main="Approximation Error")
lines(iters,eulapp, col="blue")
lines(iters,intappav, col="red", lty=2)
lines(iters,eulappav, col="blue",lty=2)
legend(4000,0.35,c("Error of Integral", "Error of Integral with VR", "Error of Euler", "Error of Euler with VR"), lty=c(1,2,1,2), col=c("red","red","blue","blue"))
